<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:74:"D:\phpstudy_pro\WWW\xqyw\public/../application/system\view\site\index.html";i:1705131470;s:65:"D:\phpstudy_pro\WWW\xqyw\application\system\view\public\head.html";i:1715411275;s:67:"D:\phpstudy_pro\WWW\xqyw\application\system\view\public\footer.html";i:1704857607;}*/ ?>
<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>后台管理系统</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="Access-Control-Allow-Origin" content="*">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="icon" href="/static/system/images/favicon.ico">
	<link rel="stylesheet" href="/static/system/css/themes/default.css" media="all">
	<link rel="stylesheet" href="/static/system/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
	<link rel="stylesheet" href="/static/system/lib/layui-v2.9.9/css/layui.css" media="all">
	<link rel="stylesheet" href="/static/system/css/public.css" media="all">
	<link rel="stylesheet" href="/static/system/css/layuimini.css?v=2.0.4.2" media="all">

	<script src="/static/system/lib/layui-v2.9.9/layui.js" charset="utf-8"></script>
	<script src="/static/system/js/lay-config.js?v=2.0.0" charset="utf-8"></script>
	<script>
        // 是否开启刷新记忆tab功能
        // var is_remember = false;
    </script>
	<!--[if lt IE 9]>
		<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
		<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	<style id="layuimini-bg-color">
	</style>
</head>
<style>
    .layui-form-item .layui-input-company {
        width: auto;
        padding-right: 10px;
        line-height: 38px;
    }
</style>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">

            <div class="layui-form layuimini-form">
                <div class="layui-form-item">
                    <label class="layui-form-label required">网站名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value="<?php echo $info['name']; ?>" lay-verify="required" lay-reqtext="网站名称不能为空"
                            placeholder="请输入网站名称" value="layuimini" class="layui-input">
                        <tip>填写自己部署网站的名称。</tip>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">网站描述</label>
                    <div class="layui-input-block">
                        <input type="text" name="desc" value="<?php echo $info['desc']; ?>"
                            placeholder="请输入网站描述" value="layuimini" class="layui-input">
                        <tip>填写自己部署网站的描述。</tip>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label required">网站地址</label>
                    <div class="layui-input-block">
                        <input type="text" name="address" value="<?php echo $info['address']; ?>" lay-verify="required" lay-reqtext="网站名称不能为空"
                            placeholder="请输入网站服务地址" value="layuimini" class="layui-input">
                        <tip>填写自己网站服务地址。</tip>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label required">标志图</label>
                    <div class="layui-input-inline">
                        <input type="hidden" name="image" id="img2" value="<?php echo $info['image']; ?>" lay-verify="required" lay-reqtext="图片不可为空">
                        <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="img">上传图片</button>
                        <div class="layui-upload-list">
                            <img class="layui-upload-img" id="img1" src="<?php echo $info['image']; ?>" style="width:300px;">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label required">版权信息</label>
                    <div class="layui-input-block">
                        <input type="text" name="copyright" value="<?php echo $info['copyright']; ?>" lay-verify="required" lay-reqtext="版权信息不能为空"
                            placeholder="版权信息" value="layuimini" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="setting">确认保存</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        layui.use(['form','upload'], function () {
            var form = layui.form
                , layer = layui.layer
                , upload = layui.upload
                ,$ = layui.$;

           //普通图片上传
           var uploadInst = upload.render({
                elem: '#img',
                url: "<?php echo url('upFiles/upload'); ?>",
                data: {width:250,height:250},
                accept: 'images', //普通文件
                exts: 'jpg|png|gif|jpeg', //只允许上传压缩文件
                before: function () {
                //开始加载效果
                    layui.use('layer', function () {
                        layui.layer.load();
                        $(".layui-layer-shade").css('background', '#000000')
                        $(".layui-layer-shade").css('opacity', '0.2')
                        $(".layui-layer-shade").click(function (event) {
                            event.stopPropagation();
                        })
                    })
                },
                done: function(res){
                    //上传成功结束加载效果
                    layui.use('layer', function () {
                        layui.layer.closeAll();
                        setTimeout(function () {
                            layui.layer.closeAll();
                        }, 2000);
                    });
                    if(res.code === 1){
                        $('#img1').attr('src', res.url);
                        $('#img2').val(res.url);
                        layer.msg(res.info, {icon: 1});
                    } else {
                        layer.msg(res.msg, {icon: 5});
                    }
                },
                error: function(){
                    //上传成功结束加载效果
                    layui.use('layer', function () {
                        layui.layer.closeAll();
                        setTimeout(function () {
                            layui.layer.closeAll();
                        }, 2000);
                    });
                    return layer.msg('上传失败',{icon:2});
                }
            });


            //监听提交
            form.on('submit(setting)', function (data) {
                delete data.field.file; // 删除文件上传的file
                $.post('', data.field, function (res) {
                    if (res.code > 0) {
                        layer.msg(res.msg, { time: 1800, icon: 1 }, function () {
                            location.reload();
                        });
                    } else {
                        layer.msg(res.msg, { time: 1800, icon: 2 });
                    }
                });
                return false;
            });

        });
    </script>
    <script>
    layui.use(['jquery', 'layer', 'miniAdmin'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            miniAdmin = layui.miniAdmin,
            iniUrl = {};
        var options = {
            iniUrl: "<?php echo url('index/getSystemInit'); ?>", // 初始化接口
            clearUrl: "clear", // 缓存清理接口
            urlHashLocation: true, // 是否打开hash定位
            bgColorDefault: false, // 主题默认配置
            multiModule: true, // 是否开启多模块
            menuChildOpen: false, // 是否默认展开菜单
            loadingTime: 0, // 初始化加载时间
            pageAnim: true, // iframe窗口动画
            maxTabNum: 20, // 最大的tab打开数量
        };
        miniAdmin.render(options);
        $('.login-out').on("click", function () {
            $.post("<?php echo url('Login/outlogin'); ?>",{},function(res) {
                layer.msg('退出登录成功', function () {
                    window.location = 'Login/index';
                });
            })

        });
    });
</script>
<script>
    //预览大小根据原图的大小决定弹窗的大小
    function previewImg(obj) {
        var img = new Image();
        img.src = obj.src;
        var height = img.height + 50; //获取图片高度
        var width = img.width; //获取图片宽度
        var imgHtml = "<img src='" + obj.src + "' width='100%' height='100%'/>";
        //弹出层
        layer.open({
            type: 1,
            shade: 0.8,
            offset: 'auto',
            // area: [height + 'px', width + 'px'],
            area: ['800px', '600px'],
            shadeClose: true,
            scrollbar: false,
            title: '', //不显示标题
            content: imgHtml, //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
            cancel: function () {
                //layer.msg('捕获就是从页面已经存在的元素上，包裹layer的结构', { time: 5000, icon: 6 });
            }
        });
    }
</script>
</body>

</html>